package com.fixme4trade.business;

import java.util.List;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.inject.Provider;

import org.slf4j.Logger;

import com.fixme4trade.domain.Customer;
import com.fixme4trade.domain.Product;
import com.fixme4trade.domain.Sell;
import com.fixme4trade.domain.Seller;
import com.fixme4trade.domain.User;
import com.fixme4trade.persistence.ProductDAO;
import br.gov.frameworkdemoiselle.message.MessageContext;
import br.gov.frameworkdemoiselle.security.SecurityContext;
import br.gov.frameworkdemoiselle.stereotype.BusinessController;
import br.gov.frameworkdemoiselle.template.DelegateCrud;
import br.gov.frameworkdemoiselle.transaction.Transactional;

@BusinessController
@ApplicationScoped
public class ProductBC extends DelegateCrud<Product, Long, ProductDAO> {
	
	private static final long serialVersionUID = 1L;
	
	@Inject
	private Logger logger;
	
	@Inject
    private MessageContext messageContext;
	
	@Inject
	private ProductDAO productDAO;
			
	@Inject
	//private Provider<UserBC> p_userBC;
	private UserBC userBC;

	
	@Override
	public void insert(Product p) {
		super.insert(p);
	}

	@Override
	public void update(Product p) {
		super.update(p);
	}

	@Override
	public void delete(Long id) {
		super.delete(id);
	}	
		
	public List<Product> getProductsByQuery(String query){
		return productDAO.getProductsByQuery(query);
	}
		
	public List<Product> getProductsBySeller(Seller seller){
		return productDAO.getProductsBySeller(seller);
	}
}
